package com.api.shopapi.mapper;


import com.api.shopapi.entity.SendMessage;
import com.api.shopapi.entity.SendMessageItem;
import com.api.shopapi.entity.dto.SendMessageDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface SendMessageItemMapper {

    @Insert("insert into send_message_item " +
            "(SendMessageItemCode,SendMessageCode,SN) values " +
            "(#{sendMessageItem.SendMessageItemCode},#{sendMessageItem.SendMessageCode}," +
            "#{sendMessageItem.SN})")
    int insert(@Param("sendMessageItem") SendMessageItem sendMessageItem);

    @Select("select * from send_message_item where SendMessageItemCode=#{sendMessageItemCode} limit 1")
    SendMessageItem getBySendMessageItemCode(@Param("sendMessageItemCode") String sendMessageItemCode);
}
